/**
 * Copyright 2009 by Christian Scheid. This file is part of the switch eclipse plugin and is licensed under the
 * GPL version 3. Please refer to the URL http://www.gnu.org/licenses/gpl-3.0.html for details.
 */
package org.digitalsoul.switchplugin;

import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;


public class BaseTester {

    
    /**
     * @return
     */
    protected IEditorPart getActiveEditor() {
        IWorkbenchPage activePage = getActivePage();
        return activePage.getActiveEditor();
    }

    /**
     * @return
     */
    protected static Shell getShell() {
        return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    }
    
    /**
     * @return
     */
    protected IWorkbenchPage getActivePage() {
        IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        return activePage;
    }
}
